<template>
  <div class="Home-wapper">
    <van-grid :column-num="4">
      <van-grid-item
        v-for="item in gridContens"
        @click="gotoModulePage(item)"
        :key="item.id"
        icon="photo-o"
        :text="item.text"
      />
    </van-grid>
  </div>
</template>

<script>
export default {
  name: "Home",
  components: {},
  data() {
    return {
      gridContens: [
        {
          id: 1,
          text: "账户总览",
          path: "AccountOverview"
        },
        {
          id: 2,
          text: "存款首页",
          path: "DepositHome"
        },
        {
          id: 3,
          text: "我的存单",
          path: "depositCertificate"
        },
        {
          id: 4,
          text: "转账汇款",
          path: "TransferRemittance"
        },
        {
          id: 5,
          text: "银行转账",
          path: "BankTransfer"
        },
        {
          id: 6,
          text: "快捷转账",
          path: "FastTransfer"
        },
      ]
    };
  },
  methods: {
    gotoModulePage(item) {
      if (!item.path) return;
      const pathFlag = /^\//.test(item.path);
      const newPath = pathFlag ? item.path : `/${item.path}`;
      this.$router.push(newPath);
    }
  }
};
</script>